home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / terms / kermit / b / ckermit.ini < prev    next >
Encoding:
Text File  |  1993-06-30  |  19.6 KB  |  612 lines

  1. COMMENT - Standard C-Kermit initialization file
  2. ;
  3. ; For C-Kermit Version: 5A(189)
  4. ;
  5. ; Filename:
  6. ;   .kermrc     (UNIX, OS-9, Aegis)
  7. ;   CKERMIT.INI (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
  8. ;
  9. ; Authors:
  10. ;   Frank da Cruz, Christine M. Gianone
  11. ;   Columbia University, New York, NY, USA
  12. ;
  13. ; OS/2 modifications for version 5A(189):
  14. ;   Jeffrey Altman
  15. ;   Altmania Productions
  16. ;
  17. ; Version 5A(188): 23 November 1992
  18. ; Version 5A(189): 27 June 1993
  19. ; Last update: Sun Jun 27 12:20:10 1993
  20. ;
  21. ; This is the standard and recommended C-Kermit 5A initialization file.
  22. ; It should be portable to all implementations of C-Kermit 5A edit 188
  23. ; and later.  To override settings or definitions made in this file, to
  24. ; add new settings or definitions, or to make any other desired
  25. ; customizations, create a separate, personal customization file called: 
  26. ;
  27. ;   .mykermrc     (UNIX, OS-9, Aegis)
  28. ;   CKERMOD.INI   (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
  29. ;
  30. ; You can also define the customization filename in an environment
  31. ; variable (logical name in VMS), CKERMOD, which takes precedence over
  32. ; the names shown above.
  33. ;
  34. ; WHAT THIS FILE DOES:
  35. ;
  36. ; . The FULLSCREEN file transfer display is selected if it is available
  37. ; . Defines your default dialing directory name:
  38. ;     .kdd for UNIX, OS-9 and Aegis; CKERMIT.KDD for other operating systems.
  39. ;        You can override this with the environment variable CKDDIR.
  40. ; . Defines your default services directory name:
  41. ;     .ksd for UNIX, OS-9 and Aegis; CKERMIT.KSD for other operating systems.
  42. ;        You can override this with environment variable CKSDIR.
  43. ; . Defines your customization file name (name given above)
  44. ; . Performs system-dependent setups for UNIX, VMS, OS/2, etc.
  45. ; . Defines an EDIT macro to let you invoke a text editor from C-Kermit.
  46. ; . Defines TSEND, BSEND, TGET, BGET macros for text and binary file transfer.
  47. ; . Defines VTPRINT, PCGET, and PCSEND macros for use with MS-DOS Kermit.
  48. ; . Opens your dialing directory if you have one.
  49. ; . Reads your services directory and defines ACCESS and LIST macros for it.
  50. ; . Executes your personal customization file, if you have one.
  51. ;
  52. ; C-Kermit 5A is documented in the book "Using C-Kermit" by Frank da Cruz
  53. ; and Christine M. Gianone, 1993, Digital Press, Burlington, MA, USA.
  54. ; Digital Press ISBN: 1-55558-108-0; Prentice-Hall ISBN: 0-13-037490-3.
  55. ; Price: US $34.95.
  56.  
  57. ; Everything after this point depends on the script programming language.
  58. ; The CHECK command terminates this command file immediately if the script
  59. ; programming language (IF command) is not configured.
  60. ;
  61. set take error on        ; This makes CHECK quit if no script language.
  62. check if            ; Do we have an IF command?  If not, quit now.
  63. set take error off        ; Back to normal.
  64.  
  65. COMMENT - Greet and make sure C-Kermit edit is 188 or higher.
  66. ;
  67. echo Executing \v(cmdfile) for \v(system)...
  68. if < \v(version) 501188 -
  69.   stop 1 \v(cmdfile): C-Kermit 5A(188) or later required.
  70.  
  71. define _dedit            ; No default editor yet.
  72. goto \v(system)            ; First do system-dependent items...
  73.  
  74. :unknown            ; Should not happen
  75. Stop 1 Error: System type unknown!
  76.  
  77. :Aegis                ; Apollo Aegis and
  78. :UNIX                ; UNIX, all versions
  79. assign _dialdir -
  80.   \v(home).kdd            ; C-Kermit dialing directory
  81. assign _servicedir -
  82.   \v(home).ksd            ; C-Kermit services directory
  83. assign _myinit -
  84.   \v(home).mykermrc        ; Customization filename
  85. check fullscreen        ; Do we have a fullscreen display?
  86. if success set file displ full  ; If so, use it.
  87. define _dedit vi        ; Default editor is VI
  88. goto common                     ; End of UNIX section
  89.  
  90. :OS9/68K            ; OS-9
  91. assign _dialdir -
  92.   \v(home).kdd            ; C-Kermit dialing directory
  93. assign _servicedir -
  94.   \v(home).ksd            ; C-Kermit services directory
  95. assign _myinit -
  96.   \v(home).mykermrc        ; Customization filename
  97. if eq "\$(TERM)" "vt100" -      ; File transfer display
  98.   set file display full         ; Only works with VT-100 terminal type
  99. else if eq "\$(TERM)" "VT100" -
  100.   set file display full
  101. else set file display crt
  102. goto common            ; End of OS-9 section
  103.  
  104. :VMS                ; VMS and OpenVMS
  105. define _dedit edit        ; Default editor is EDIT.
  106. set file display fullscreen     ; File transfer fisplay
  107. goto common
  108.  
  109. :OS/2                ; OS/2
  110. assign _inifile \v(cmdfile)    ; Get directory where this file is kept...
  111. assign _inidirlen \feval(\flength(\m(_inifile))-11)
  112. assign _inidir \fsubstr(\m(_inifile),1,\m(_inidirlen))
  113. assign _dialdir    \m(_inidir)CKERMIT.KDD
  114. assign _servicedir \m(_inidir)CKERMIT.KSD
  115. assign _myinit     \m(_inidir)CKERMOD.INI
  116. assign _inifile            ; Release unneeded variables
  117. assign _inidirlen
  118. assign _inidir
  119. set file display fullscreen     ; File transfer fisplay
  120. set server display on        ; Show display in server mode too.
  121. define _dedit e            ; Default editor is E
  122. set command bytesize 8          ; Use 8 bits between Kermit and console.
  123. set xfer char latin1            ; Use Latin-1 for text file transfer.
  124. define cls echo \27[H\27[2J     ; Define CLS command to clear the screen.
  125. define os2 push            ; Make OS2 a synonym for PUSH, RUN, etc.
  126. define more run more < \%1    ; Easy access to MORE command.
  127. define vdir run dir | more    ; "Verbose" DIRECTORY
  128. define tdir run dir /o-d | more ; Reverse Time-Order DIRECTORY
  129. goto common                     ; End of OS/2 section
  130.  
  131. :AOS/VS                ; Data General AOS/VS
  132. define _dedit sed        ; Default editor is SED
  133. set file char dg-international    ; File character-set
  134. set xfer char latin1        ; Transfer character-set
  135. set file display crt            ; File transfer fisplay
  136. define cli push            ; Escape to CLI
  137. define reset -            ; Macro to reset DG DASHER terminal
  138.  run write [!ascii 236 306 301]
  139. goto common                     ; End of AOS/VS section
  140.  
  141. :Amiga                ; Commodore Amiga
  142. define cls echo \27[H\27[2J     ; CLS command to clear the screen
  143. set file display full           ; Supports fullscreen display
  144. set file char latin1        ; Use Latin Alphabet 1 for file transfer
  145. set xfer char latin1        ; ...
  146. goto common                     ; End of Amiga section
  147.  
  148. :Atari_ST            ; Atari ST
  149. define cls echo \27H\27J    ; Clear screen a`la VT52
  150. set file display crt        ; FULLSCREEN not available
  151. set server display on        ; Show file xfer display in server mode too
  152. set server timeout 15        ; Nonzero required for ^C interruption!
  153. goto common                     ; End of Atari ST section
  154.  
  155. :Macintosh            ; Apple Macintosh
  156. set server display on        ; Show file xfer display in server mode too.
  157.  
  158. :COMMON                ; System-independent items
  159.  
  160. ; Make the C-Kermit prompt show my current directory.
  161. ; Environment variable or logical name CKPROMPT takes precedence.
  162. ;
  163. if def \$(CKPROMPT) set prompt \$(CKPROMPT)
  164.   else if eq "\v(system)" "VMS" set prompt \v(dir) C-Kermit>
  165.   else  set prompt [\v(dir)] C-Kermit>
  166.  
  167. COMMENT - Macros to send and get binary and text files.
  168. ;
  169. define binary set file type binary
  170. define text set file type text
  171. define bsend set file type binary, send \%1 \%2         ; Send binary file(s)
  172. define tsend set file type text, send \%1 \%2         ; Send text file(s)
  173. define bget remote set file type binary, -           ; Get binary file(s)
  174.   if success get \%1 \%2                             ;  from server
  175. define tget remote set file type text, -             ; Get text file(s)
  176.   if success get \%1                                 ;  from server
  177.  
  178. COMMENT - EDIT macro.
  179. ;
  180. ; EDITOR environment variable, if defined, takes precedence.
  181. ;
  182. check push            ; Only works if we have a PUSH command
  183. if fail goto macros        ; (so it doesn't work on the Macintosh).
  184.  
  185. if def \$(EDITOR) assign myeditor \$(EDITOR)
  186.   else assign myeditor \m(_dedit)
  187. if not def myeditor def myeditor edit
  188. define _dedit
  189. define myfile
  190.  
  191. define edit if = \v(argc) 2 assign myfile \%1,-
  192.   if not def myfile echo Edit what?,-
  193.   else run \m(myeditor) \m(myfile)
  194.  
  195. :MACROS
  196.  
  197. ; Define macros that are useful when running C-Kermit in remote mode.
  198. ; These macros serve no purpose on local-mode-only versions such as
  199. ; OS/2, Macintosh, Amiga, and Atari ST Kermit, so we skip defining them
  200. ; for those systems.
  201. ;
  202. if not = 0 \findex(\v(system),OS/2:Macintosh:Amiga:Atari_ST) goto files
  203.  
  204. COMMENT - VTPRINT macro.  Print a file on your PC's local printer.
  205. ;
  206. define vtprint echo \27[5i, type \%1, echo \27[4i
  207.  
  208. COMMENT - Macros for host-initiated file transfer with MS-DOS Kermit.
  209. ;
  210. ; The method for doing this changed in June/July 1993, when C-Kermit 5A(189)
  211. ; and MS-DOS Kermit 3.13 were released (at approximately the same time).
  212. ; There is no good way for C-Kermit to find out the MS-DOS Kermit version
  213. ; number, so we determine which method to use based on the C-Kermit version.
  214. ;
  215. if > \v(version) 501188 goto apc
  216.  
  217. COMMENT - PCGET macro, for use with MS-DOS Kermit 3.12 and earlier.  Argument:
  218. ; 1 = Name of file to get from MS-DOS Kermit.
  219. ; Requires MS-DOS Kermit macro TERMINALS defined as "server, connect".
  220. ;
  221. define pcget echo \27[\?34h, get \%1, finish
  222.  
  223. COMMENT - PCSEND macro, for use with MS-DOS Kermit 3.12 and earlier.  Args:
  224. ; \%1 = Name of file to send to MS-DOS Kermit.
  225. ; \%2 = Optional name to send it with.
  226. ; Requires MS-DOS Kermit macro TERMINALR defined as "receive, connect".
  227. ;
  228. define pcsend asg \%9 \ffiles(\%1),-
  229.   if = 0 \%9 end 1 {\?File not found},-
  230.   set delay 1, echo \27[\?34l,-
  231.   if = 1 \%9 send \%1 \%2,-  ; Single file with as-name
  232.   else send \%1              ; or wildcard with no as-name
  233.  
  234. goto files
  235.  
  236. :APC
  237.  
  238. COMMENT - PCGET macro, for use with MS-DOS Kermit 3.13 and later.  Arguments:
  239. ; 1 = Name of file to get from MS-DOS Kermit.
  240. ; 2 = Optional name that C-Kermit should store it under.
  241. ;
  242. define pcget apc {send \%1 \%2}, receive
  243.  
  244. COMMENT - PCSEND macro, for use with MS-DOS Kermit 3.13 and later.  Args:
  245. ; \%1 = Name of file to send to MS-DOS Kermit.
  246. ; \%2 = Optional name to send it with.
  247. ;
  248. define pcsend asg \%9 \ffiles(\%1),-
  249.   if = 0 \%9 end 1 {\?File not found},-
  250.   set delay 1, apc receive,-
  251.   if = 1 \%9 send \%1 \%2,-  ; Single file with as-name
  252.   else send \%1              ; or wildcard with no as-name
  253.  
  254. :FILES
  255.  
  256. ; Get customization, dialing directory, and services directory filenames.
  257. ; Let environment variables take precedence, so users do not have to edit
  258. ; this file to change these filenames.
  259. ;
  260. if def \$(CKERMOD) assign _myinit \$(CKERMOD)
  261. if not def _myinit assign _myinit \v(home)CKERMOD.INI
  262.  
  263. if def \$(CKDDIR) assign _dialdir \$(CKDDIR)
  264. if not def _dialdir assign _dialdir \v(home)CKERMIT.KDD
  265.  
  266. if def \$(CKSDIR) assign _servicedir \$(CKSDIR)
  267. if not def _servicedir assign _servicedir \v(home)CKERMIT.KSD
  268.  
  269. CHECK DIAL            ; Is the DIAL command enabled?
  270. xif fail { -            ; No.
  271.     echo DIAL disabled -
  272. } else { -            ; Yes, check for and open the dial directory.
  273.     xif exist \m(_dialdir) { -
  274.         set dial directory \m(_dialdir), -
  275.         echo { Dial directory is \m(_dialdir) } -
  276.     } -
  277. }
  278.  
  279. COMMENT - Check for existence of services directory
  280. ;
  281. if not exist \m(_servicedir) goto noservices
  282.  
  283. COMMENT - Have services directory, so read it and define related macros
  284. ;
  285. echo { Services directory is \m(_servicedir)}
  286.  
  287. def max_svcs 50               ; Adjust this if you have more than 50 entries!
  288. open read \m(_servicedir)     ; Open services directory file
  289. xif fail { -
  290.     echo Can't open \m(_servicedir), -
  291.     goto noservices -
  292. }
  293. declare \&d[\m(max_svcs)]     ; Declare array for service directory entries
  294. for \%i 1 \m(max_svcs) 1 { -  ; Read entries into array
  295.     read \&d[\%i], -
  296.     if fail goto done -
  297. }
  298. close read                    ; Didn't reach the end
  299. echo -                        ; Close the file and print useful message
  300.   \?Too many entries in services directory:
  301. echo { Maximum is \m(max_svcs).}
  302. echo { Change definition of max_svcs in \v(cmdfile) to allow more. }
  303. echo { Services directory disabled.}
  304. goto noservices
  305.  
  306. :DONE                         ; We have the services directory in memory
  307. asg \&d[0] \feval(\%i - 1)    ; Keep size of array in zeroth element
  308.  
  309. ; LIST macro.  Arguments:
  310. ; \%1 = service name (optional)
  311. ;
  312. define LIST -
  313.   if > \v(argc) 1 goto search, -
  314.   echo \&d[0] items in services directory:, -   ; No search item
  315.   for \%i 1 \&d[0] 1 { echo \&d[\%i] }, end, -  ; List whole directory
  316. :search, -                                      ; Search item given
  317.   lookup \%1, -                                 ; Look it up
  318.   if def \v(return) echo \v(return), -          ; List it if found
  319.   else echo \%1: Not found                      ; or say it wasn't
  320.  
  321. COMMENT - SERIAL macro.  Arguments:
  322. ; \%1 = device name
  323. ; \%2 = speed
  324. ;
  325. define SERIAL -
  326.   if < \v(argc) 3 -                       ; All arguments given?
  327.     end 1 Usage: SERIAL device speed,-    ; No.
  328.   set line \%1,-                          ; OK, try to SET LINE.
  329.   if failure -                            ; If this failed,
  330.     end 1 Can't open device: \%1,-        ; print message and quit.
  331.   set speed \%2,-                         ; Try to set the speed.
  332.   if fail end 1 Unsupported speed: \%2,-  ; Failed.
  333.   echo Connection successful.             ; Succeeded.
  334.  
  335. COMMENT - NET macro.  Arguments:
  336. ; \%1 = network type
  337. ; \%2 = host name or address
  338. ;
  339. define NET if < \v(argc) 3 end 1 Usage: NET network host,-
  340.   set network \%1,-
  341.   if fail end 1 unsupported network: \%1,-
  342.   set host \%2,-
  343.   if fail end 1 can't reach host: \%2,-
  344.   echo Connection successful.
  345.  
  346. COMMENT - CALL macro.  Arguments:
  347. ;
  348. ; \%1 = modem type
  349. ; \%2 = device name
  350. ; \%3 = speed
  351. ; \%4 = phone number
  352. ;
  353. define CALL if < \v(argc) 5 end 1 Usage: CALL modem device speed number,-
  354.   set modem \%1,-
  355.   if fail end 1 unknown modem type: \%1,-
  356.   set line \%2,-
  357.   if fail end 1 can't open device: \%2,-
  358.   set speed \%3,-
  359.   if fail end 1 unsupported speed: \%3,-
  360.   for \%i 1 10 1 { -
  361.     xif > \%i 1 { -
  362.         echo Will redial in 1 minute: please wait...,-
  363.         pause 60,-
  364.         echo Redialing: try number \%i...,-
  365.     },-
  366.     dial \%4,-
  367.     if success goto ok,-
  368.     hangup,-
  369.   } -
  370.   end 1 Can't place call: \%4,-
  371.   :ok,-
  372.   pause 1,-
  373.   echo Connection successful.
  374.  
  375. COMMENT - SPRINT macro.  Arguments:
  376. ; \%1 = Service name or address
  377. ;
  378. define SPRINT -
  379.     if < \v(argc) 2 end 1 Usage: \%0 service,-
  380.     set input timeout proceed,-
  381.     output \13\13,-
  382.     input 10 TERMINAL=,-
  383.     if fail end 1 No terminal prompt,-
  384.     out D1\13,-
  385.     inp 10 @,-
  386.     if fail end 1 No atsign prompt,-
  387.     output c \%1\13,-
  388.     input 10 CONNECTED,-
  389.     if fail end 1 Can't access \%1 from SprintNet
  390.  
  391. COMMENT - VMSLOGIN macro.  Arguments:
  392. ; \%1 = VMS user ID
  393. ; \%2 = Password.  If password not supplied, it is prompted for.
  394. ;
  395. define VMSLOGIN if < \v(argc) 2 end 1 Usage: VMSLOGIN userid password,-
  396.     while not defined \%2 { -
  397.         askq \%2 { \%1's password: } -
  398.     },-
  399.     set parity none,-
  400.     set duplex full,-
  401.     set handshake none,-
  402.     set flow xon/xoff,-
  403.     set input timeout proceed,-
  404.     for \%i 1 3 1 { -
  405.         out \13,-
  406.         in 5 Username:,-
  407.         if success goto dologin -
  408.     },-
  409.     end 1 No Username prompt,-
  410. :dologin,-
  411.     out \%1\13,-
  412.     inp 5 Password:,-
  413.     if fail end 1 No password prompt,-
  414.     out \%2\13,-
  415.     def \%2,-
  416.     set inp ech off,-
  417.     inp 10 \27Z,-
  418.     if success output \27[\?1c,-
  419.     set inp ech on,-
  420.     inp 60 {\13\10$ },-                 ; CHANGE THIS IF NECESSARY!
  421.     if fail end 1 No system prompt,-
  422.     echo Login successful.
  423.  
  424. COMMENT - UNIXLOGIN macro.  Arguments:
  425. ; \%1 = user ID
  426. ; \%2 = password
  427. ;
  428. define UNIXLOGIN if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  429.     while not defined \%2 { -
  430.         askq \%2 { \%1's password: } -
  431.     },-
  432.     set parity none,-
  433.     set duplex full,-
  434.     set handshake none,-
  435.     set flow xon/xoff,-
  436.     set case on,-
  437.     out \13,-
  438.     set input timeout proceed,-
  439.     for \%i 1 15 1 { -
  440.         in 5 login:,-
  441.         if success goto dologin,-
  442.         output \\B -
  443.     },-
  444.     end 1 No login prompt,-
  445. :dologin,-
  446.     out \%1\13,-
  447.     inp 5 Password:,-
  448.     if fail end 1 No password prompt,-
  449.     out \%2\13,-
  450.     def \%2,-
  451.     inp 60 {\13\10$ },-                 ; CHANGE THIS IF NECESSARY!
  452.     if fail end 1 No system prompt,-
  453.     echo Login successful.
  454.  
  455. COMMENT - VMLINELOGIN macro.  Arguments:
  456. ; \%1 = User ID
  457. ; \%2 = Password
  458. ;
  459. define VMLINELOGIN -
  460.     if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  461.     while not defined \%2 { -
  462.         askq \%2 { \%1's password: } -
  463.     },-
  464.     set parity mark,-
  465.     set flow none,-
  466.     set handshake xon,-
  467.     set duplex half,-
  468.     set input timeout quit,-
  469.     input 10 BREAK KEY,-
  470.     pause 1,-
  471.     output \\B,-
  472.     input 10 .\17, output login \%1\13,-
  473.     input 10 .\17, output \%2\13,-
  474.     input 10 .\17, output \13,-
  475.     input 10 .\17, output \13,-
  476.     set input timeout proceed,-
  477.     echo Login successful.
  478.  
  479. COMMENT - VMFULLOGIN macro.  Arguments:
  480. ; \%1 = User ID
  481. ; \%2 = Password
  482. ;
  483. define VMFULLOGIN -
  484.     if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  485.     while not defined \%2 { -
  486.         askq \%2 { \%1's password: } -
  487.     },-
  488.     set input timeout quit,-
  489.     set parity even,-
  490.     set duplex full,-
  491.     set handshake none,-
  492.     set flow xon/xoff,-
  493.     out \13,-
  494.     inp 5 TERMINAL TYPE:,-
  495.     out vt-100\13,-
  496.     inp 20 RUNNING,-
  497.     pau 1,-
  498.     out \%1\9\%2\13,-
  499.     out \13\13,-
  500.     set input timeout proceed,-
  501.     echo Login successful.
  502.  
  503. COMMENT - CISLOGIN macro for CompuServe.  Arguments:
  504. ; \%1 = CompuServe User ID
  505. ; \%2 = Password
  506. ;
  507. define CISLOGIN -
  508.     if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  509.     while not defined \%2 { -
  510.         askq \%2 { \%1's password: } -
  511.     },-
  512.     set input timeout quit,-
  513.     output \13,-
  514.     input 5 Host Name:,-
  515.     output cis\13,-
  516.     input 5 User ID:,-
  517.     output \%2\13,-
  518.     input Password:,-
  519.     output \%3\13,-
  520.     input 20 Enter Choice!,-
  521.     set input timeout proceed,-
  522.     echo Login successful.
  523.  
  524. COMMENT - DOWLOGIN macro for Dow Jones News/Retrieval.  Arguments:
  525. ; \%1 = Dow Jones Password
  526. ;
  527. define DOWLOGIN -
  528.     while not defined \%1 { -
  529.         askq \%1 { Dow Jones password: } -
  530.     },-
  531.     set input timeout proceed,-
  532.     input 20 SERVICE PLEASE\?\?\?\?,-
  533.     if fail end 1 no service prompt,-
  534.     out djnr\13,-
  535.     input 10 @@@@,-
  536.     if fail end 1 No password prompt,-
  537.     pause 1,-
  538.     output \%1\13,-
  539.     input 20 ENTER QUERY,-
  540.     if fail end 1 No main query prompt,-
  541.     pause 1@,-
  542.     echo Login successful.
  543.  
  544. COMMENT - DJNRSPRINT macro: Log in to Dow Jones via SprintNet.
  545. ;
  546. define djnrsprint sprint dow, dowlogin
  547.  
  548. COMMENT - NOLOGIN macro.  Does nothing.  Use when login not required.
  549. ;
  550. define nologin comment
  551.  
  552. COMMENT - LOOKUP macro.  Argument:
  553. ; \%1 = Service name to look for in services directory
  554. ;
  555. define LOOKUP -
  556.     set case off,-          ; Ignore alphabetic case
  557.     for \%i 1 \&d[0] 1 { -  ; Loop thru services directory
  558.         if eq \%1 \fsubstr(\&d[\%i],1,\flen(\%1)) - ; Got a match?
  559.           break -           ; If so, we're done
  560.     },-
  561.     if not > \%i \&d[0] return \&d[\%i] ; Return the entry
  562.  
  563. define DOACCESS -        ; (Used internally by ACCESS macro)
  564.     asg \%1 \fsubstr(\%1,2),-   ; Trim password argument
  565.     do \%5 \%6 \%7 \%8 \%9,-    ; Do the connection macro
  566.     if success do \%3 \%4 \%1   ; Do the login macro
  567.  
  568. ; ACCESS macro.  Arguments:
  569. ; \%1 = service name
  570. ; \%2 = password (optional)
  571. ;
  572. define ACCESS -
  573.     if not defined \%1 end 1 access what?,-      ; Check service
  574.     lookup \%1,-                                 ; Look it up
  575.     if success doaccess { \%2} \v(return),-      ; OK, try it
  576.     else end 1 "\%1" not in services directory,- ; Not found
  577.     if fail stop 1                               ; DOACCESS failed?
  578.  
  579. goto endservices        ; Skip around NOSERVICES definitions.
  580.  
  581. :NOSERVICES
  582. define access echo { Services directory not available.}
  583. assign list \m(access)
  584.  
  585. :ENDSERVICES
  586.  
  587. COMMENT - In VMS and OpenVMS, allow for system-wide site customizations
  588. ;
  589. if not equal "\v(system)" "VMS" goto custom
  590. xif exist CKERMIT_INI:CKERMIT.SYS { -
  591.     echo Executing CKERMIT_INI:CKERMIT.SYS, -
  592.     take CKERMIT_INI:CKERMIT.SYS -
  593. }
  594.  
  595. COMMENT - Execute user's personal customization file
  596. ;
  597. :CUSTOM
  598. xif exist \m(_myinit)  { -        ; If it exists,
  599.     echo Executing \m(_myinit)..., -    ; print message,
  600.     take \m(_myinit) -            ; and TAKE the file.
  601. }
  602.  
  603. COMMENT - Greeting.
  604. ;
  605. if < \v(ntime) 43200 echo Good Morning!
  606.   else if < \v(ntime) 61200 echo Good Afternoon!
  607.   else echo Good Evening
  608.  
  609. ; End of C-Kermit 5A initialization file.
  610.  
  611.  
  612.